class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.r: G = None
        self.p: F = None
        self.x: D = None
        self.q: A = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.y: A = None
        self.s: A = None
        self.v: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.s: C = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.w: D = None
        self.p: B = None
        self.q: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.r: G = None
        self.p: F = None
        self.x: D = None
        self.q: A = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.y: A = None
        self.s: A = None
        self.v: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.s: C = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.w: D = None
        self.p: B = None
        self.q: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

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

b.w = n
b.o = f
e.w = h
e.s = h
e.r = c
e.p = j
e.x = f
e.q = b
e.u = b
h.o = f
h.r = e
h.s = e
h.w = b
f.w = c
f.u = h
f.r = h
f.y = b
f.s = b
f.v = n
n.z = f
n.x = j
n.w = j
n.s = h
n.r = b
j.o = e
j.p = e
j.r = c
j.q = c
j.w = f
j.u = b
c.s = e
c.v = b
c.q = j
assert e.p.r.q.u.txt == "b"