class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.s: D = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.q: C = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

g = A("g")
f = B("f")
b = C("b")
j = D("j")
c = E("c")
e = F("e")
n = D("n")
i = F("i")

g.u = n
f.x = g
f.o = j
f.s = n
f.t = e
f.r = c
b.o = c
b.y = c
b.p = g
j.u = n
j.z = g
j.y = b
c.t = n
e.y = b
e.s = b
e.q = b
e.x = j
e.r = n
n.u = j
n.z = g
n.y = b
i.y = b
i.s = b
i.q = b
i.x = n
i.r = n
assert e.x.y.p.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.s: D = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.q: C = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

g = A("g")
f = B("f")
b = C("b")
j = D("j")
c = E("c")
e = F("e")
n = D("n")
i = F("i")

g.u = n
f.x = g
f.o = j
f.s = n
f.t = e
f.r = c
b.o = c
b.y = c
b.p = g
j.u = n
j.z = g
j.y = b
c.t = n
e.y = b
e.s = b
e.q = b
e.x = j
e.r = n
n.u = j
n.z = g
n.y = b
i.y = b
i.s = b
i.q = b
i.x = n
i.r = n
assert e.x.y.p.u.y.txt == "b"