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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.o: C = None
        self.t: C = None
        self.u: A = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.q: B = None
        self.y: H = None
        self.r: G = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.s: F = None
        self.t: D = None
        self.x: F = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: F = None
        self.q: F = None
        self.o: E = None
        self.w: B = None
        self.v: B = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

g = A("g")
l = B("l")
k = C("k")
f = D("f")
b = E("b")
h = F("h")
a = G("a")
c = H("c")

g.u = b
l.x = k
l.o = k
l.t = k
l.w = b
l.u = g
l.z = a
k.s = l
f.r = a
f.o = a
f.w = l
b.u = c
b.w = c
b.y = c
b.q = l
b.r = a
b.s = f
b.t = f
h.x = a
a.w = g
a.p = g
a.r = c
a.s = h
a.x = h
a.t = f
a.v = f
c.z = a
c.s = a
c.r = h
c.q = h
c.o = b
c.w = l
c.v = l
c.u = g
assert b.r.t.w.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: C = None
        self.w: E = None
        self.o: C = None
        self.t: C = None
        self.u: A = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.q: B = None
        self.y: H = None
        self.r: G = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.s: F = None
        self.t: D = None
        self.x: F = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: F = None
        self.q: F = None
        self.o: E = None
        self.w: B = None
        self.v: B = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

g = A("g")
l = B("l")
k = C("k")
f = D("f")
b = E("b")
h = F("h")
a = G("a")
c = H("c")

g.u = b
l.x = k
l.o = k
l.t = k
l.w = b
l.u = g
l.z = a
k.s = l
f.r = a
f.o = a
f.w = l
b.u = c
b.w = c
b.y = c
b.q = l
b.r = a
b.s = f
b.t = f
h.x = a
a.w = g
a.p = g
a.r = c
a.s = h
a.x = h
a.t = f
a.v = f
c.z = a
c.s = a
c.r = h
c.q = h
c.o = b
c.w = l
c.v = l
c.u = g
assert b.r.t.w.u.txt == "g"