class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.o: F = None
        self.x: E = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

f.u = k
f.w = k
f.t = c
f.o = c
f.x = m
f.y = a
a.r = k
a.y = f
a.u = m
a.w = m
k.t = l
k.x = f
k.s = a
k.o = a
k.q = m
k.r = m
l.s = i
l.y = f
m.y = k
m.u = k
m.r = c
m.z = a
c.p = f
h.s = c
h.y = f
i.p = f
assert k.r.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.o: F = None
        self.x: E = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

f.u = k
f.w = k
f.t = c
f.o = c
f.x = m
f.y = a
a.r = k
a.y = f
a.u = m
a.w = m
k.t = l
k.x = f
k.s = a
k.o = a
k.q = m
k.r = m
l.s = i
l.y = f
m.y = k
m.u = k
m.r = c
m.z = a
c.p = f
h.s = c
h.y = f
i.p = f
assert k.r.u.t.txt == "l"