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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: E = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

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

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

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

l = A("l")
h = B("h")
e = C("e")
m = D("m")
a = E("a")
f = F("f")
g = A("g")
k = E("k")
b = B("b")

l.r = g
h.y = l
h.t = l
h.q = b
h.o = k
e.z = m
e.v = m
e.u = a
e.o = b
m.x = g
m.u = g
m.y = h
a.s = m
a.t = f
a.x = l
f.s = k
f.v = h
g.r = l
k.s = m
k.t = f
k.x = l
b.y = l
b.t = l
b.q = h
b.o = a
assert e.u.x.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: E = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

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

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

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

l = A("l")
h = B("h")
e = C("e")
m = D("m")
a = E("a")
f = F("f")
g = A("g")
k = E("k")
b = B("b")

l.r = g
h.y = l
h.t = l
h.q = b
h.o = k
e.z = m
e.v = m
e.u = a
e.o = b
m.x = g
m.u = g
m.y = h
a.s = m
a.t = f
a.x = l
f.s = k
f.v = h
g.r = l
k.s = m
k.t = f
k.x = l
b.y = l
b.t = l
b.q = h
b.o = a
assert e.u.x.r.r.txt == "l"