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

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

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

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

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

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

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

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

d = A("d")
b = B("b")
j = C("j")
m = D("m")
l = E("l")
n = F("n")
c = G("c")
i = H("i")
e = B("e")

d.x = n
b.y = i
b.z = n
j.y = d
m.u = l
m.q = l
l.o = c
l.p = b
n.u = c
c.x = n
c.t = d
c.q = j
i.q = l
i.v = m
e.y = i
e.z = n
assert m.q.p.y.q.p.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

d = A("d")
b = B("b")
j = C("j")
m = D("m")
l = E("l")
n = F("n")
c = G("c")
i = H("i")
e = B("e")

d.x = n
b.y = i
b.z = n
j.y = d
m.u = l
m.q = l
l.o = c
l.p = b
n.u = c
c.x = n
c.t = d
c.q = j
i.q = l
i.v = m
e.y = i
e.z = n
assert m.q.p.y.q.p.y.v.u.txt == "l"