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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: E = None
        self.p: A = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.q: F = None
        self.z: H = None
        self.w: E = None
        self.v: A = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
d = D("d")
b = E("b")
f = F("f")
c = G("c")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: E = None
        self.p: A = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.q: F = None
        self.z: H = None
        self.w: E = None
        self.v: A = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
d = D("d")
b = E("b")
f = F("f")
c = G("c")
k = H("k")

g.u = b
j.x = d
j.o = d
j.v = d
j.q = b
j.p = g
n.u = f
n.q = f
n.t = d
n.z = k
n.w = b
n.r = b
n.v = g
n.y = g
d.x = f
d.r = j
d.o = n
d.u = n
d.t = k
d.s = b
b.y = d
b.r = g
b.u = k
f.p = g
f.v = n
c.o = n
k.t = c
assert k.t.o.y.u.txt == "b"