class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.w: D = None
        self.t: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.s: A = None
        self.q: F = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.q: D = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

h = A("h")
j = B("j")
c = C("c")
f = D("f")
m = E("m")
g = F("g")

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.w: D = None
        self.t: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.s: A = None
        self.q: F = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.q: D = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

h = A("h")
j = B("j")
c = C("c")
f = D("f")
m = E("m")
g = F("g")

h.r = g
h.z = g
h.u = j
h.v = f
j.v = m
j.o = m
j.q = h
j.r = h
j.w = f
c.y = m
c.t = m
c.x = m
c.p = h
c.w = f
f.t = c
f.v = m
f.s = h
f.u = h
f.q = g
f.o = j
m.u = j
m.v = h
m.p = f
g.s = h
g.y = h
g.t = j
g.q = f
g.p = f
assert h.z.y.z.y.u.txt == "j"