class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.t: D = None
        self.v: G = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

d.p = m
d.v = m
d.z = f
d.t = l
d.r = c
d.u = j
h.v = c
h.u = c
c.u = i
c.v = l
l.u = i
l.v = j
l.p = d
j.x = i
i.z = j
i.s = m
i.t = l
m.t = j
m.o = j
m.y = j
m.x = c
f.u = i
f.v = l
assert l.p.p.x.v.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.t: D = None
        self.v: G = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

d.p = m
d.v = m
d.z = f
d.t = l
d.r = c
d.u = j
h.v = c
h.u = c
c.u = i
c.v = l
l.u = i
l.v = j
l.p = d
j.x = i
i.z = j
i.s = m
i.t = l
m.t = j
m.o = j
m.y = j
m.x = c
f.u = i
f.v = l
assert l.p.p.x.v.p.u.txt == "j"