class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.v: A = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

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

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

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

c = A("c")
b = B("b")
i = C("i")
f = D("f")
a = E("a")
j = F("j")
m = F("m")
l = F("l")

c.q = f
c.t = a
c.w = a
c.o = j
b.r = j
b.u = i
i.t = b
i.x = b
i.z = f
i.v = c
i.r = a
f.r = b
f.u = i
a.q = b
a.r = c
a.v = j
j.w = m
j.u = a
j.o = f
m.w = l
m.u = a
m.o = f
l.w = j
l.u = a
l.o = f
assert a.v.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.v: A = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

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

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

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

c = A("c")
b = B("b")
i = C("i")
f = D("f")
a = E("a")
j = F("j")
m = F("m")
l = F("l")

c.q = f
c.t = a
c.w = a
c.o = j
b.r = j
b.u = i
i.t = b
i.x = b
i.z = f
i.v = c
i.r = a
f.r = b
f.u = i
a.q = b
a.r = c
a.v = j
j.w = m
j.u = a
j.o = f
m.w = l
m.u = a
m.o = f
l.w = j
l.u = a
l.o = f
assert a.v.u.r.txt == "c"