class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.z: C = None
        self.s: D = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: E = None
        self.txt = txt

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

f = A("f")
l = B("l")
e = C("e")
j = D("j")
d = E("d")
b = F("b")
n = G("n")
a = H("a")
k = E("k")
c = D("c")

f.y = a
l.q = a
l.t = a
e.r = c
e.x = d
j.y = b
d.z = b
b.t = a
b.o = f
b.z = e
b.s = c
b.v = j
b.r = l
n.t = e
n.o = j
n.v = d
a.p = f
a.x = f
k.z = b
c.y = b
assert e.x.z.v.y.t.p.y.p.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.z: C = None
        self.s: D = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: E = None
        self.txt = txt

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

f = A("f")
l = B("l")
e = C("e")
j = D("j")
d = E("d")
b = F("b")
n = G("n")
a = H("a")
k = E("k")
c = D("c")

f.y = a
l.q = a
l.t = a
e.r = c
e.x = d
j.y = b
d.z = b
b.t = a
b.o = f
b.z = e
b.s = c
b.v = j
b.r = l
n.t = e
n.o = j
n.v = d
a.p = f
a.x = f
k.z = b
c.y = b
assert e.x.z.v.y.t.p.y.p.y.p.txt == "f"