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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.p: D = None
        self.w: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.r: E = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

g = A("g")
b = B("b")
l = C("l")
e = D("e")
c = E("c")
d = F("d")
k = E("k")
j = D("j")
a = F("a")

g.y = e
g.t = l
b.v = e
b.x = a
l.w = d
l.t = a
e.p = a
c.o = g
c.w = g
c.r = e
c.p = e
c.t = d
d.p = b
d.w = c
d.r = k
d.o = k
d.y = g
k.o = g
k.w = g
k.r = j
k.p = e
k.t = d
j.p = a
a.p = b
a.w = c
a.o = c
a.r = k
a.y = g
assert d.p.x.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.p: D = None
        self.w: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.r: E = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

g = A("g")
b = B("b")
l = C("l")
e = D("e")
c = E("c")
d = F("d")
k = E("k")
j = D("j")
a = F("a")

g.y = e
g.t = l
b.v = e
b.x = a
l.w = d
l.t = a
e.p = a
c.o = g
c.w = g
c.r = e
c.p = e
c.t = d
d.p = b
d.w = c
d.r = k
d.o = k
d.y = g
k.o = g
k.w = g
k.r = j
k.p = e
k.t = d
j.p = a
a.p = b
a.w = c
a.o = c
a.r = k
a.y = g
assert d.p.x.p.v.txt == "e"