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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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