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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
f = C("f")
n = D("n")
k = E("k")
j = F("j")
c = G("c")
g = G("g")
h = F("h")

l.t = j
e.s = k
f.o = h
f.u = l
n.w = l
n.o = l
n.u = e
n.x = f
k.r = n
k.x = n
j.q = n
j.p = h
c.x = j
c.r = l
g.x = j
g.r = l
h.q = n
h.p = j
assert f.o.p.q.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
f = C("f")
n = D("n")
k = E("k")
j = F("j")
c = G("c")
g = G("g")
h = F("h")

l.t = j
e.s = k
f.o = h
f.u = l
n.w = l
n.o = l
n.u = e
n.x = f
k.r = n
k.x = n
j.q = n
j.p = h
c.x = j
c.r = l
g.x = j
g.r = l
h.q = n
h.p = j
assert f.o.p.q.x.o.txt == "h"