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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
g = C("g")
d = D("d")
f = E("f")
j = F("j")
a = A("a")
b = C("b")
m = F("m")

i.o = d
i.r = m
i.s = a
e.o = d
e.v = m
g.y = j
g.z = d
g.w = d
g.r = d
g.u = f
d.r = b
d.t = b
f.x = j
j.u = i
j.v = m
a.o = d
a.r = j
a.s = i
b.y = m
b.z = d
b.w = d
b.r = d
b.u = f
m.u = i
m.v = j
assert i.o.r.y.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
g = C("g")
d = D("d")
f = E("f")
j = F("j")
a = A("a")
b = C("b")
m = F("m")

i.o = d
i.r = m
i.s = a
e.o = d
e.v = m
g.y = j
g.z = d
g.w = d
g.r = d
g.u = f
d.r = b
d.t = b
f.x = j
j.u = i
j.v = m
a.o = d
a.r = j
a.s = i
b.y = m
b.z = d
b.w = d
b.r = d
b.u = f
m.u = i
m.v = j
assert i.o.r.y.v.v.v.v.txt == "m"