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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: G = None
        self.o: B = None
        self.r: B = None
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.w: E = None
        self.r: E = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

f = A("f")
h = B("h")
d = C("d")
n = D("n")
l = E("l")
g = F("g")
e = G("e")
c = C("c")
i = A("i")
m = G("m")

f.x = c
h.q = l
h.x = l
h.v = m
h.u = m
d.x = l
n.u = m
n.t = m
n.o = h
n.r = h
n.p = c
n.s = l
l.y = e
l.u = h
g.s = l
g.w = l
g.r = l
g.v = d
g.u = f
g.t = f
e.t = n
c.x = l
i.x = d
m.t = n
assert i.x.x.y.t.t.t.p.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: G = None
        self.o: B = None
        self.r: B = None
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.w: E = None
        self.r: E = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

f = A("f")
h = B("h")
d = C("d")
n = D("n")
l = E("l")
g = F("g")
e = G("e")
c = C("c")
i = A("i")
m = G("m")

f.x = c
h.q = l
h.x = l
h.v = m
h.u = m
d.x = l
n.u = m
n.t = m
n.o = h
n.r = h
n.p = c
n.s = l
l.y = e
l.u = h
g.s = l
g.w = l
g.r = l
g.v = d
g.u = f
g.t = f
e.t = n
c.x = l
i.x = d
m.t = n
assert i.x.x.y.t.t.t.p.x.y.txt == "e"