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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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