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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.q: F = None
        self.s: F = None
        self.p: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.q: F = None
        self.s: F = None
        self.p: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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