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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
j = C("j")
h = D("h")
e = E("e")
f = F("f")

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
j = C("j")
h = D("h")
e = E("e")
f = F("f")

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